gfg practice problem